﻿@using SelfMadeMillionaire.Core.Enums
@using SelfMadeMillionaire.Web.Infrastructure
@using SelfMadeMillionaire.Web.Infrastructure.Formatters
@using SelfMadeMillionaire.Web.Infrastructure.ViewModels.MailingList
@using PagedList.Mvc
@model MailingListViewModel

	<div class="table-responsive">
		@if (Model.Transactions.Any())
  {
			<table class="table table-bordered tablesorter">
				<thead>
					<tr>
						<th><a href="#">User ID</a></th>
						<th><a href="#">Invoice ID</a></th>
						<th><a href="#">Invoice Date</a></th>
						<th><a href="#">Product</a></th>
						<th><a href="#">Amount</a></th>
						<th><a href="#">Paypal Response</a></th>
						<th><a href="#">Time of payment</a></th>

					</tr>
				</thead>
				<tbody>
					@foreach (var item in Model.Transactions)
	 {
						<tr>
							<td>@item.Payment.Order.Subscriber.ID</td>
							<td>@item.Payment.Order.ID</td>
							<td>@item.Payment.Order.CreatedDate</td>
							<td>@(item.Payment.ItemName + " " + item.Payment.ItemNumber)</td>
							<td>@item.Payment.McGross</td>
							<td></td>
							<td>@item.Payment.PaymentDate</td>
						</tr>
	 }
				</tbody>
			</table>
	  @Html.PagedListPager(Model.Transactions, paget => Url.Action("Index", new { paget, firstName = Model.FirstName, lastName = Model.LastName, selectedProduct = Model.ProductTypes.SelectedValue, email = Model.Email, page = Model.Page }))
  }
  else
  {
			<p>No records found.</p>
  }
	</div>
